Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TLS support in api pkg / cli #3108

Merged
merged 3 commits into from
Aug 28, 2017
Merged

Fix TLS support in api pkg / cli #3108

merged 3 commits into from
Aug 28, 2017

Conversation

schmichael
Copy link
Member

Fixes #3013

It's a little weird that Client now has a method for returning a
NewClient, but it's a convenient way to dedupe the logic to
connect-directly-to-a-node which is nontrivial and had sutble
differences between locations.

Fixes #3013

It's a little weird that Client now has a method for returning a
NewClient, but it's a convenient way to dedupe the logic to
connect-directly-to-a-node which is nontrivial and had sutble
differences between locations.
@schmichael schmichael requested a review from dadgar August 28, 2017 18:49
api/api.go Outdated
region = c.config.Region
} else {
// Use the region from the agent
agentRegion, err := c.Agent().Region()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems odd. There may not be an agent if this is being embedded in another program and it would cause an error. It should just do nothing as the http handler would default to the global region

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this query the agent at NOMAD_ADDR for the region? That seems potentially useful even in embedded circumstances.

(This logic was cargo culted from the previous location, so I may not fully grok it)

api/api.go Outdated
return nodeClient, nil
}

if *q == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand this logic. If there isn't a reason for it, can you remove and just take a pointer, not a pointer to a pointer.

- No need to for a pointer to a pointer
- Properly set and use QueryOptions.Region
@schmichael schmichael merged commit 63b715f into master Aug 28, 2017
@schmichael schmichael deleted the b-3013-stats-tls branch August 28, 2017 22:37
schmichael added a commit that referenced this pull request Aug 28, 2017
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants